<!-- <form action="{% url 'polls:vote' question.id %}" method="post">
{% csrf_token %}
<fieldset>
    <legend><h1>{{ question.question_text }}</h1></legend>
    {% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
    {% for choice in question.choice_set.all %}
        <input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}">
        <label for="choice{{ forloop.counter }}">{{ choice.choice_text }}</label><br>
    {% endfor %}
</fieldset>
<input type="submit" value="Vote">
</form> -->


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vote: {{ question.question_text }}</title>
    <style>
        :root {
            --primary: #6c5ce7;
            --secondary: #a29bfe;
            --accent: #fd79a8;
            --light: #f8f9fa;
            --dark: #2d3436;
            --success: #00b894;
            --info: #0984e3;
            --warning: #fdcb6e;
            --danger: #d63031;
        }
        
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            color: var(--dark);
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        h1 {
            color: var(--primary);
            font-size: 1.8rem;
            margin-bottom: 25px;
            text-align: center;
            padding-bottom: 10px;
            border-bottom: 2px dashed var(--secondary);
        }
        
        form {
            background: white;
            padding: 30px;
            border-radius: 15px;
            box-shadow: 0 15px 30px rgba(0,0,0,0.1);
            position: relative;
            overflow: hidden;
        }
        
        form::after {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 100px;
            height: 100px;
            background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
            opacity: 0.2;
            z-index: 0;
        }
        
        fieldset {
            border: 2px dashed var(--secondary);
            border-radius: 10px;
            padding: 25px;
            margin-bottom: 25px;
            position: relative;
            z-index: 1;
            background: white;
        }
        
        legend {
            padding: 0 15px;
            font-weight: bold;
            color: var(--primary);
            font-size: 1.3rem;
            background: white;
            border-radius: 20px;
            border: 2px solid var(--secondary);
        }
        
        .choice {
            margin-bottom: 15px;
            padding: 12px;
            border-radius: 8px;
            transition: all 0.3s;
            background: rgba(162, 155, 254, 0.05);
            border-left: 3px solid transparent;
        }
        
        .choice:hover {
            background: rgba(162, 155, 254, 0.1);
            border-left: 3px solid var(--accent);
            transform: translateX(5px);
        }
        
        input[type="radio"] {
            appearance: none;
            -webkit-appearance: none;
            width: 18px;
            height: 18px;
            border: 2px solid var(--secondary);
            border-radius: 50%;
            margin-right: 15px;
            position: relative;
            top: 3px;
            transition: all 0.3s;
        }
        
        input[type="radio"]:checked {
            border-color: var(--accent);
            background-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(253, 121, 168, 0.3);
        }
        
        label {
            font-size: 1.1rem;
            cursor: pointer;
        }
        
        input[type="submit"] {
            background: linear-gradient(to right, var(--primary), var(--accent));
            color: white;
            border: none;
            padding: 15px 30px;
            border-radius: 30px;
            cursor: pointer;
            font-size: 1.1rem;
            font-weight: bold;
            transition: all 0.3s;
            display: block;
            margin: 0 auto;
            box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4);
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        
        input[type="submit"]:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(108, 92, 231, 0.6);
        }
        
        .error-message {
            color: var(--danger);
            padding: 15px;
            background-color: rgba(214, 48, 49, 0.1);
            border-radius: 8px;
            margin-bottom: 25px;
            border-left: 4px solid var(--danger);
            font-weight: bold;
        }
        
        .back-link {
            display: inline-block;
            margin-top: 30px;
            color: var(--primary);
            text-decoration: none;
            font-weight: bold;
            transition: all 0.3s;
        }
        
        .back-link:hover {
            color: var(--accent);
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <a href="/polls/" class="back-link">← Back to Polls</a>
    
    <form action="{% url 'polls:vote' question.id %}" method="post">
    {% csrf_token %}
    <fieldset>
        <legend><h1>{{ question.question_text }}</h1></legend>
        {% if error_message %}<p class="error-message"><strong>{{ error_message }}</strong></p>{% endif %}
        {% for choice in question.choice_set.all %}
            <div class="choice">
                <input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}">
                <label for="choice{{ forloop.counter }}">{{ choice.choice_text }}</label>
            </div>
        {% endfor %}
    </fieldset>
    <input type="submit" value="Cast Your Vote">
    </form>
</body>
</html>

